import React from 'react';
import ReactDOM from 'react-dom';
import 'antd/dist/antd.css'
import EventPush from '../components/eventpushrouter.jsx';

import '../css/custom.css';
import '../css/wechatmobile.css'

import { baseUrl } from "./config.js";
import Axios from "axios";
Axios.defaults.baseURL = baseUrl;


export let updateSafetySceneStatusApi = (schoolId, photo, createTime, status) => {
    return (
        Axios.post(baseUrl + "weChatSystem/updateSafetySceneStatusAndGetId", {
            schoolId: schoolId,
            photo: photo,
            createTime: createTime,
            status: status
        })
    );
};

export let updateSafetySceneStatusAndContent = (schoolId, photo, createTime, status, content) => {
    return (
        Axios.post(baseUrl + "weChatSystem/updateSafetySceneStatusAndContent", {
            schoolId: schoolId,
            photo: photo,
            createTime: createTime,
            status: status,
            content: content
        })
    );
};

export let getSafetySceneStatusApi = (schoolId, photo, createTime) => {
    return (
        Axios.post(baseUrl + "weChatSystem/getSafetySceneStatus", {
            schoolId: schoolId,
            photo: photo,
            createTime: createTime
        })
    );
};

export let insertSafetySceneDealApi = (safetySceneId, dealContent, dealUser) => {
    return (
        Axios.post(baseUrl + "weChatSystem/insertSafetySceneDeal", {
            safetySceneId: safetySceneId,
            dealContent: dealContent,
            dealUser: dealUser,
        })
    );
};

export let getRealNameByWechatIdApi = (schoolId, openId) => {
    return (
        Axios.post(baseUrl + "weChatSystem/getRealNameByWechatId", {
            department: schoolId,
            weChatIdForSendMsg: openId
        })
    );
};



export let getWechatGetOpenIdApi = (code) => {
    return (
        Axios.get(baseUrl + "weChatSystem/getWechatGetOpenId", {
            params: {
                code:code
            }
        })
    );
};

export let getSafetySceneDealInfoApi = (safetySceneId) => {
    return (
        Axios.post(baseUrl + "weChatSystem/getSafetySceneDealInfo", {
            safetySceneId: safetySceneId,
        })
    );
};

ReactDOM.render(<EventPush />, document.getElementById('root'));